package com.xinsilu.hospital.controller;


import com.xinsilu.common.Result;
import com.xinsilu.hospital.entity.OrderTable;
import com.xinsilu.hospital.service.IOrderTableService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author ym
 * @since 2021-09-22
 */
@RestController
@RequestMapping("/api/hospital/orderTable")
public class OrderTableController {
    @Autowired
    private IOrderTableService iOrderTableService;

    @PostMapping("/addyz")
    public Object addyz(OrderTable orderTable){
        boolean save = iOrderTableService.save(orderTable);
        if(save){
            return Result.ok("成功");
        }
        return Result.ok(save);
    }

    @RequestMapping("/sfby")
    public Object sfby(@Param("patientId") int patientId){
        List<OrderTable> sfby = iOrderTableService.sfby(patientId);
        return Result.ok(sfby);
    }

}
